package com.mysteel.cyx.demo.baomidou.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

/**
 * https://baomidou.com/pages/8390a4/#jackson
 */
public enum SexEnum {

    BOY(0, "男生"),
    GIRL(1, "女生"),
    UN_KNOW(-1, "未知");

    SexEnum(int sex, String sexDesc) {
        this.sex = sex;
        this.sexDesc = sexDesc;
    }

    @EnumValue//标记数据库存的值是code
    private final int sex;
    private final String sexDesc;

    public int getSex() {
        return sex;
    }

    public String getSexDesc() {
        return sexDesc;
    }

    @Override
    public String toString() {
        return "SexEnum{" +
                "sex=" + sex +
                ", sexDesc='" + sexDesc + '\'' +
                '}';
    }
}